package Demo1;

public class ThreadDemo {
    public static void main(String[] args) {
        /**
         * 多线程第一种启动方式
         * 继承Thread类
         * 重写run方法
         */
        MyThread myThread1 = new MyThread();
        MyThread myThread2 = new MyThread();
        myThread1.setName("线程1");
        myThread2.setName("线程2");
        myThread1.start();
        myThread2.start();
    }
}
